package com.deke.baby.service.impl;

import java.util.List;
import com.deke.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.deke.baby.mapper.BabyBillMapper;
import com.deke.baby.domain.BabyBill;
import com.deke.baby.service.IBabyBillService;

/**
 * 家庭Service业务层处理
 *
 * @author deke
 * @date 2023-06-28
 */
@Service
public class BabyBillServiceImpl implements IBabyBillService
{
    @Autowired
    private BabyBillMapper babyBillMapper;

    /**
     * 查询家庭
     *
     * @param id 家庭主键
     * @return 家庭
     */
    @Override
    public BabyBill selectBabyBillById(Long id)
    {
        return babyBillMapper.selectBabyBillById(id);
    }

    /**
     * 查询家庭列表
     *
     * @param babyBill 家庭
     * @return 家庭
     */
    @Override
    public List<BabyBill> selectBabyBillList(BabyBill babyBill)
    {
        return babyBillMapper.selectBabyBillList(babyBill);
    }

    /**
     * 新增家庭
     *
     * @param babyBill 家庭
     * @return 结果
     */
    @Override
    public int insertBabyBill(BabyBill babyBill)
    {
        babyBill.setCreateTime(DateUtils.getNowDate());
        return babyBillMapper.insertBabyBill(babyBill);
    }

    /**
     * 修改家庭
     *
     * @param babyBill 家庭
     * @return 结果
     */
    @Override
    public int updateBabyBill(BabyBill babyBill)
    {
        babyBill.setUpdateTime(DateUtils.getNowDate());
        return babyBillMapper.updateBabyBill(babyBill);
    }

    /**
     * 批量删除家庭
     *
     * @param ids 需要删除的家庭主键
     * @return 结果
     */
    @Override
    public int deleteBabyBillByIds(Long[] ids)
    {
        return babyBillMapper.deleteBabyBillByIds(ids);
    }

    /**
     * 删除家庭信息
     *
     * @param id 家庭主键
     * @return 结果
     */
    @Override
    public int deleteBabyBillById(Long id)
    {
        return babyBillMapper.deleteBabyBillById(id);
    }
}
